/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "plano_natureza_financeira")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PlanoNaturezaFinanceira.findAll", query = "SELECT p FROM PlanoNaturezaFinanceira p")})
public class PlanoNaturezaFinanceira implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(length = 100)
    private String nome;
    @Column(name = "DATA_INCLUSAO")
    @Temporal(TemporalType.DATE)
    private Date dataInclusao;
    @Column(length = 50)
    private String mascara;
    private Integer niveis;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPlanoNaturezaFinanceira")
    private List<EmpresaPlano> empresaPlanoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPlanoNaturezaFinanceira")
    private List<NaturezaFinanceira> naturezaFinanceiraList;

    public PlanoNaturezaFinanceira() {
    }

    public PlanoNaturezaFinanceira(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public Date getDataInclusao() {
        return dataInclusao;
    }

    public void setDataInclusao(Date dataInclusao) {
        this.dataInclusao = dataInclusao;
    }

    public String getMascara() {
        return mascara;
    }

    public void setMascara(String mascara) {
        this.mascara = mascara;
    }

    public Integer getNiveis() {
        return niveis;
    }

    public void setNiveis(Integer niveis) {
        this.niveis = niveis;
    }

    @XmlTransient
    public List<EmpresaPlano> getEmpresaPlanoList() {
        return empresaPlanoList;
    }

    public void setEmpresaPlanoList(List<EmpresaPlano> empresaPlanoList) {
        this.empresaPlanoList = empresaPlanoList;
    }

    @XmlTransient
    public List<NaturezaFinanceira> getNaturezaFinanceiraList() {
        return naturezaFinanceiraList;
    }

    public void setNaturezaFinanceiraList(List<NaturezaFinanceira> naturezaFinanceiraList) {
        this.naturezaFinanceiraList = naturezaFinanceiraList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PlanoNaturezaFinanceira)) {
            return false;
        }
        PlanoNaturezaFinanceira other = (PlanoNaturezaFinanceira) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.PlanoNaturezaFinanceira[ id=" + id + " ]";
    }
    
}
